package com.cwj.timingTask;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author chenwujie
 * @date 2020/11/049:20
 */
public class MyTask implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        System.out.println("Thread-" + Thread.currentThread().getName() + "|time-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "|info-" + "test");

//        for (int i = 0; i < 5; i++) {
//            System.out.println(jobExecutionContext);
//            System.out.println("Thread-" + Thread.currentThread().getName() + "|time-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "|info-" + "test" + (i+1));
//            try {
//                Thread.sleep(1000 * 5);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
//        }
    }
}
